﻿using UnityEngine;
using System.Collections;

public class Distroy : MonoBehaviour {
	
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		transform.Rotate(new Vector3(15, 30, 45) * Time.deltaTime);
	}
	void OnCollisionEnter(Collision collision)
	{       
		if (collision.collider.tag == "ball") {//碰撞的是cube            
			this.gameObject.SetActive (false);   
		} 
	}
}


